{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Port of King Abdul Aziz','Port of Mersin','Port of Jebel Ali']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of King Abdul Aziz', 'Port of Mersin', 'Port of Jebel Ali']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Santos','Port of Montreal','Port of Vancouver','Port of Shanghai','Port of Marseille','Port of Bandar Abbas','Port of Haifa','Port of Aktau','Port of Busan','Penang Port','Port of Oslo','Port of Vladivostok','Port of Novorossiysk','Port of St. Petersburg','Port of Belgrade','Port of Mersin','Port of Odessa','Port of New York','Port of Los Angeles']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Santos',\n",
       " 'Port of Montreal',\n",
       " 'Port of Vancouver',\n",
       " 'Port of Shanghai',\n",
       " 'Port of Marseille',\n",
       " 'Port of Bandar Abbas',\n",
       " 'Port of Haifa',\n",
       " 'Port of Aktau',\n",
       " 'Port of Busan',\n",
       " 'Penang Port',\n",
       " 'Port of Oslo',\n",
       " 'Port of Vladivostok',\n",
       " 'Port of Novorossiysk',\n",
       " 'Port of St. Petersburg',\n",
       " 'Port of Belgrade',\n",
       " 'Port of Mersin',\n",
       " 'Port of Odessa',\n",
       " 'Port of New York',\n",
       " 'Port of Los Angeles']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [9716,7528,9407])),\n",
    "dict(zip(demand_points, [9778,6195,9470])),\n",
    "dict(zip(demand_points, [10668,12320,10440])),\n",
    "dict(zip(demand_points, [6922,8546,6627])),\n",
    "dict(zip(demand_points, [5388,1806,5080])),\n",
    "dict(zip(demand_points, [365,3520,173])),\n",
    "dict(zip(demand_points, [3674,233,3366])),\n",
    "dict(zip(demand_points, [5301,2174,5094])),\n",
    "dict(zip(demand_points, [7438,9062,7143])),\n",
    "dict(zip(demand_points, [3896,5520,3601])),\n",
    "dict(zip(demand_points, [7981,10049,7673])),\n",
    "dict(zip(demand_points, [8022,9645,7727])),\n",
    "dict(zip(demand_points, [5193,1552,4885])),\n",
    "dict(zip(demand_points, [8841,5258,8532])),\n",
    "dict(zip(demand_points, [5470,1829,5162])),\n",
    "dict(zip(demand_points, [3885,0,3576])),\n",
    "dict(zip(demand_points, [5011,1370,4703])),\n",
    "dict(zip(demand_points, [9222,5617,8918])),\n",
    "dict(zip(demand_points, [11344,11024,11116]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of King Abdul Aziz': 9716,\n",
       "  'Port of Mersin': 7528,\n",
       "  'Port of Jebel Ali': 9407},\n",
       " 'Port of Montreal': {'Port of King Abdul Aziz': 9778,\n",
       "  'Port of Mersin': 6195,\n",
       "  'Port of Jebel Ali': 9470},\n",
       " 'Port of Vancouver': {'Port of King Abdul Aziz': 10668,\n",
       "  'Port of Mersin': 12320,\n",
       "  'Port of Jebel Ali': 10440},\n",
       " 'Port of Shanghai': {'Port of King Abdul Aziz': 6922,\n",
       "  'Port of Mersin': 8546,\n",
       "  'Port of Jebel Ali': 6627},\n",
       " 'Port of Marseille': {'Port of King Abdul Aziz': 5388,\n",
       "  'Port of Mersin': 1806,\n",
       "  'Port of Jebel Ali': 5080},\n",
       " 'Port of Bandar Abbas': {'Port of King Abdul Aziz': 365,\n",
       "  'Port of Mersin': 3520,\n",
       "  'Port of Jebel Ali': 173},\n",
       " 'Port of Haifa': {'Port of King Abdul Aziz': 3674,\n",
       "  'Port of Mersin': 233,\n",
       "  'Port of Jebel Ali': 3366},\n",
       " 'Port of Aktau': {'Port of King Abdul Aziz': 5301,\n",
       "  'Port of Mersin': 2174,\n",
       "  'Port of Jebel Ali': 5094},\n",
       " 'Port of Busan': {'Port of King Abdul Aziz': 7438,\n",
       "  'Port of Mersin': 9062,\n",
       "  'Port of Jebel Ali': 7143},\n",
       " 'Penang Port': {'Port of King Abdul Aziz': 3896,\n",
       "  'Port of Mersin': 5520,\n",
       "  'Port of Jebel Ali': 3601},\n",
       " 'Port of Oslo': {'Port of King Abdul Aziz': 7981,\n",
       "  'Port of Mersin': 10049,\n",
       "  'Port of Jebel Ali': 7673},\n",
       " 'Port of Vladivostok': {'Port of King Abdul Aziz': 8022,\n",
       "  'Port of Mersin': 9645,\n",
       "  'Port of Jebel Ali': 7727},\n",
       " 'Port of Novorossiysk': {'Port of King Abdul Aziz': 5193,\n",
       "  'Port of Mersin': 1552,\n",
       "  'Port of Jebel Ali': 4885},\n",
       " 'Port of St. Petersburg': {'Port of King Abdul Aziz': 8841,\n",
       "  'Port of Mersin': 5258,\n",
       "  'Port of Jebel Ali': 8532},\n",
       " 'Port of Belgrade': {'Port of King Abdul Aziz': 5470,\n",
       "  'Port of Mersin': 1829,\n",
       "  'Port of Jebel Ali': 5162},\n",
       " 'Port of Mersin': {'Port of King Abdul Aziz': 3885,\n",
       "  'Port of Mersin': 0,\n",
       "  'Port of Jebel Ali': 3576},\n",
       " 'Port of Odessa': {'Port of King Abdul Aziz': 5011,\n",
       "  'Port of Mersin': 1370,\n",
       "  'Port of Jebel Ali': 4703},\n",
       " 'Port of New York': {'Port of King Abdul Aziz': 9222,\n",
       "  'Port of Mersin': 5617,\n",
       "  'Port of Jebel Ali': 8918},\n",
       " 'Port of Los Angeles': {'Port of King Abdul Aziz': 11344,\n",
       "  'Port of Mersin': 11024,\n",
       "  'Port of Jebel Ali': 11116}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Magnesium Demand\n",
    "magnesium_demand=dict(zip(demand_points, [146051985.5,126667931.3,138667973.3]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of King Abdul Aziz': 146051985.5,\n",
       " 'Port of Mersin': 126667931.3,\n",
       " 'Port of Jebel Ali': 138667973.3}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "magnesium_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Magnesium Supply\n",
    "magnesium_supply=dict(zip(supply_points, [4204466.2090,1222172.6320,363811.2924,298590444.7000,2010234.6250,1585983.9250,7566106.3450,6113002.8630,4078244.4230,47579.5177,5189339.4020,9195220.1200,4484984.5940,4536578.4990,379084.0981,3324539.5030,41313949.6100,10124868.6300,7057279.1490])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': 4204466.209,\n",
       " 'Port of Montreal': 1222172.632,\n",
       " 'Port of Vancouver': 363811.2924,\n",
       " 'Port of Shanghai': 298590444.7,\n",
       " 'Port of Marseille': 2010234.625,\n",
       " 'Port of Bandar Abbas': 1585983.925,\n",
       " 'Port of Haifa': 7566106.345,\n",
       " 'Port of Aktau': 6113002.863,\n",
       " 'Port of Busan': 4078244.423,\n",
       " 'Penang Port': 47579.5177,\n",
       " 'Port of Oslo': 5189339.402,\n",
       " 'Port of Vladivostok': 9195220.12,\n",
       " 'Port of Novorossiysk': 4484984.594,\n",
       " 'Port of St. Petersburg': 4536578.499,\n",
       " 'Port of Belgrade': 379084.0981,\n",
       " 'Port of Mersin': 3324539.503,\n",
       " 'Port of Odessa': 41313949.61,\n",
       " 'Port of New York': 10124868.63,\n",
       " 'Port of Los Angeles': 7057279.149}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "magnesium_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Santos', 'Port of King Abdul Aziz'),\n",
       " ('Port of Santos', 'Port of Mersin'),\n",
       " ('Port of Santos', 'Port of Jebel Ali'),\n",
       " ('Port of Montreal', 'Port of King Abdul Aziz'),\n",
       " ('Port of Montreal', 'Port of Mersin'),\n",
       " ('Port of Montreal', 'Port of Jebel Ali'),\n",
       " ('Port of Vancouver', 'Port of King Abdul Aziz'),\n",
       " ('Port of Vancouver', 'Port of Mersin'),\n",
       " ('Port of Vancouver', 'Port of Jebel Ali'),\n",
       " ('Port of Shanghai', 'Port of King Abdul Aziz'),\n",
       " ('Port of Shanghai', 'Port of Mersin'),\n",
       " ('Port of Shanghai', 'Port of Jebel Ali'),\n",
       " ('Port of Marseille', 'Port of King Abdul Aziz'),\n",
       " ('Port of Marseille', 'Port of Mersin'),\n",
       " ('Port of Marseille', 'Port of Jebel Ali'),\n",
       " ('Port of Bandar Abbas', 'Port of King Abdul Aziz'),\n",
       " ('Port of Bandar Abbas', 'Port of Mersin'),\n",
       " ('Port of Bandar Abbas', 'Port of Jebel Ali'),\n",
       " ('Port of Haifa', 'Port of King Abdul Aziz'),\n",
       " ('Port of Haifa', 'Port of Mersin'),\n",
       " ('Port of Haifa', 'Port of Jebel Ali'),\n",
       " ('Port of Aktau', 'Port of King Abdul Aziz'),\n",
       " ('Port of Aktau', 'Port of Mersin'),\n",
       " ('Port of Aktau', 'Port of Jebel Ali'),\n",
       " ('Port of Busan', 'Port of King Abdul Aziz'),\n",
       " ('Port of Busan', 'Port of Mersin'),\n",
       " ('Port of Busan', 'Port of Jebel Ali'),\n",
       " ('Penang Port', 'Port of King Abdul Aziz'),\n",
       " ('Penang Port', 'Port of Mersin'),\n",
       " ('Penang Port', 'Port of Jebel Ali'),\n",
       " ('Port of Oslo', 'Port of King Abdul Aziz'),\n",
       " ('Port of Oslo', 'Port of Mersin'),\n",
       " ('Port of Oslo', 'Port of Jebel Ali'),\n",
       " ('Port of Vladivostok', 'Port of King Abdul Aziz'),\n",
       " ('Port of Vladivostok', 'Port of Mersin'),\n",
       " ('Port of Vladivostok', 'Port of Jebel Ali'),\n",
       " ('Port of Novorossiysk', 'Port of King Abdul Aziz'),\n",
       " ('Port of Novorossiysk', 'Port of Mersin'),\n",
       " ('Port of Novorossiysk', 'Port of Jebel Ali'),\n",
       " ('Port of St. Petersburg', 'Port of King Abdul Aziz'),\n",
       " ('Port of St. Petersburg', 'Port of Mersin'),\n",
       " ('Port of St. Petersburg', 'Port of Jebel Ali'),\n",
       " ('Port of Belgrade', 'Port of King Abdul Aziz'),\n",
       " ('Port of Belgrade', 'Port of Mersin'),\n",
       " ('Port of Belgrade', 'Port of Jebel Ali'),\n",
       " ('Port of Mersin', 'Port of King Abdul Aziz'),\n",
       " ('Port of Mersin', 'Port of Mersin'),\n",
       " ('Port of Mersin', 'Port of Jebel Ali'),\n",
       " ('Port of Odessa', 'Port of King Abdul Aziz'),\n",
       " ('Port of Odessa', 'Port of Mersin'),\n",
       " ('Port of Odessa', 'Port of Jebel Ali'),\n",
       " ('Port of New York', 'Port of King Abdul Aziz'),\n",
       " ('Port of New York', 'Port of Mersin'),\n",
       " ('Port of New York', 'Port of Jebel Ali'),\n",
       " ('Port of Los Angeles', 'Port of King Abdul Aziz'),\n",
       " ('Port of Los Angeles', 'Port of Mersin'),\n",
       " ('Port of Los Angeles', 'Port of Jebel Ali')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Santos_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali},\n",
       " 'Port of Montreal': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Montreal_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali},\n",
       " 'Port of Vancouver': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Vancouver_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali},\n",
       " 'Port of Shanghai': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Shanghai_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali},\n",
       " 'Port of Marseille': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Marseille_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali},\n",
       " 'Port of Bandar Abbas': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali},\n",
       " 'Port of Haifa': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Haifa_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali},\n",
       " 'Port of Aktau': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Aktau_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali},\n",
       " 'Port of Busan': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Busan_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali},\n",
       " 'Penang Port': {'Port of King Abdul Aziz': ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Penang_Port_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Penang_Port_Port_of_Jebel_Ali},\n",
       " 'Port of Oslo': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Oslo_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali},\n",
       " 'Port of Vladivostok': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali},\n",
       " 'Port of Novorossiysk': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali},\n",
       " 'Port of St. Petersburg': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali},\n",
       " 'Port of Belgrade': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Belgrade_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali},\n",
       " 'Port of Mersin': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Mersin_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali},\n",
       " 'Port of Odessa': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Odessa_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali},\n",
       " 'Port of New York': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_New_York_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali},\n",
       " 'Port of Los Angeles': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5520*ShipmentAmount_Penang_Port_Port_of_Mersin + 5094*ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali + 5301*ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz + 2174*ShipmentAmount_Port_of_Aktau_Port_of_Mersin + 173*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali + 365*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz + 3520*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin + 5162*ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali + 5470*ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz + 1829*ShipmentAmount_Port_of_Belgrade_Port_of_Mersin + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 9062*ShipmentAmount_Port_of_Busan_Port_of_Mersin + 3366*ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali + 3674*ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz + 233*ShipmentAmount_Port_of_Haifa_Port_of_Mersin + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 11024*ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 1806*ShipmentAmount_Port_of_Marseille_Port_of_Mersin + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 9470*ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali + 9778*ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz + 6195*ShipmentAmount_Port_of_Montreal_Port_of_Mersin + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 5617*ShipmentAmount_Port_of_New_York_Port_of_Mersin + 4885*ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali + 5193*ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz + 1552*ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin + 4703*ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali + 5011*ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz + 1370*ShipmentAmount_Port_of_Odessa_Port_of_Mersin + 7673*ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali + 7981*ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz + 10049*ShipmentAmount_Port_of_Oslo_Port_of_Mersin + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 7528*ShipmentAmount_Port_of_Santos_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 8532*ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali + 8841*ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz + 5258*ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin + 10440*ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali + 10668*ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz + 12320*ShipmentAmount_Port_of_Vancouver_Port_of_Mersin + 7727*ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali + 8022*ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz + 9645*ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin + 0\n",
       "VARIABLES\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5520*ShipmentAmount_Penang_Port_Port_of_Mersin + 5094*ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali + 5301*ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz + 2174*ShipmentAmount_Port_of_Aktau_Port_of_Mersin + 173*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali + 365*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz + 3520*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin + 5162*ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali + 5470*ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz + 1829*ShipmentAmount_Port_of_Belgrade_Port_of_Mersin + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 9062*ShipmentAmount_Port_of_Busan_Port_of_Mersin + 3366*ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali + 3674*ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz + 233*ShipmentAmount_Port_of_Haifa_Port_of_Mersin + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 11024*ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 1806*ShipmentAmount_Port_of_Marseille_Port_of_Mersin + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 9470*ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali + 9778*ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz + 6195*ShipmentAmount_Port_of_Montreal_Port_of_Mersin + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 5617*ShipmentAmount_Port_of_New_York_Port_of_Mersin + 4885*ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali + 5193*ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz + 1552*ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin + 4703*ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali + 5011*ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz + 1370*ShipmentAmount_Port_of_Odessa_Port_of_Mersin + 7673*ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali + 7981*ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz + 10049*ShipmentAmount_Port_of_Oslo_Port_of_Mersin + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 7528*ShipmentAmount_Port_of_Santos_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 8532*ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali + 8841*ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz + 5258*ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin + 10440*ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali + 10668*ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz + 12320*ShipmentAmount_Port_of_Vancouver_Port_of_Mersin + 7727*ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali + 8022*ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz + 9645*ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz >= 146051985.5\n",
       "\n",
       "_C2: ShipmentAmount_Penang_Port_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin >= 126667931.3\n",
       "\n",
       "_C3: ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali >= 138667973.3\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= magnesium_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5520*ShipmentAmount_Penang_Port_Port_of_Mersin + 5094*ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali + 5301*ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz + 2174*ShipmentAmount_Port_of_Aktau_Port_of_Mersin + 173*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali + 365*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz + 3520*ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin + 5162*ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali + 5470*ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz + 1829*ShipmentAmount_Port_of_Belgrade_Port_of_Mersin + 7143*ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali + 7438*ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz + 9062*ShipmentAmount_Port_of_Busan_Port_of_Mersin + 3366*ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali + 3674*ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz + 233*ShipmentAmount_Port_of_Haifa_Port_of_Mersin + 11116*ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali + 11344*ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz + 11024*ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin + 5080*ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali + 5388*ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz + 1806*ShipmentAmount_Port_of_Marseille_Port_of_Mersin + 3576*ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali + 3885*ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz + 9470*ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali + 9778*ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz + 6195*ShipmentAmount_Port_of_Montreal_Port_of_Mersin + 8918*ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali + 9222*ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz + 5617*ShipmentAmount_Port_of_New_York_Port_of_Mersin + 4885*ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali + 5193*ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz + 1552*ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin + 4703*ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali + 5011*ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz + 1370*ShipmentAmount_Port_of_Odessa_Port_of_Mersin + 7673*ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali + 7981*ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz + 10049*ShipmentAmount_Port_of_Oslo_Port_of_Mersin + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 7528*ShipmentAmount_Port_of_Santos_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 8532*ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali + 8841*ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz + 5258*ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin + 10440*ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali + 10668*ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz + 12320*ShipmentAmount_Port_of_Vancouver_Port_of_Mersin + 7727*ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali + 8022*ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz + 9645*ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz >= 146051985.5\n",
       "\n",
       "_C2: ShipmentAmount_Penang_Port_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin >= 126667931.3\n",
       "\n",
       "_C3: ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali >= 138667973.3\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Mersin = 4204466.209\n",
       "\n",
       "_C5: ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Mersin = 1222172.632\n",
       "\n",
       "_C6: ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Mersin = 363811.2924\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin = 298590444.7\n",
       "\n",
       "_C8: ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Mersin = 2010234.625\n",
       "\n",
       "_C9: ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin = 1585983.925\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Haifa_Port_of_Mersin = 7566106.345\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Aktau_Port_of_Mersin = 6113002.863\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Mersin = 4078244.423\n",
       "\n",
       "_C13: ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Penang_Port_Port_of_Mersin = 47579.5177\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Oslo_Port_of_Mersin = 5189339.402\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin = 9195220.12\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin = 4484984.594\n",
       "\n",
       "_C17: ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin = 4536578.499\n",
       "\n",
       "_C18: ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Belgrade_Port_of_Mersin = 379084.0981\n",
       "\n",
       "_C19: ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Mersin_Port_of_Mersin = 3324539.503\n",
       "\n",
       "_C20: ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Odessa_Port_of_Mersin = 41313949.61\n",
       "\n",
       "_C21: ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Mersin = 10124868.63\n",
       "\n",
       "_C22: ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin = 7057279.149\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Aktau_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Belgrade_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Haifa_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Mersin_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Odessa_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Oslo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == magnesium_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali = 47579.518\n",
      "ShipmentAmount_Port_of_Aktau_Port_of_Mersin = 6113002.9\n",
      "ShipmentAmount_Port_of_Bandar_Abbas_Port_of_King_Abdul_Aziz = 1585983.9\n",
      "ShipmentAmount_Port_of_Belgrade_Port_of_Mersin = 379084.1\n",
      "ShipmentAmount_Port_of_Busan_Port_of_Jebel_Ali = 4078244.4\n",
      "ShipmentAmount_Port_of_Haifa_Port_of_Mersin = 7566106.3\n",
      "ShipmentAmount_Port_of_Los_Angeles_Port_of_Mersin = 7057279.1\n",
      "ShipmentAmount_Port_of_Marseille_Port_of_Mersin = 2010234.6\n",
      "ShipmentAmount_Port_of_Mersin_Port_of_Mersin = 3324539.5\n",
      "ShipmentAmount_Port_of_Montreal_Port_of_Mersin = 1222172.6\n",
      "ShipmentAmount_Port_of_New_York_Port_of_Mersin = 10124869.0\n",
      "ShipmentAmount_Port_of_Novorossiysk_Port_of_Mersin = 4484984.6\n",
      "ShipmentAmount_Port_of_Odessa_Port_of_Mersin = 41313950.0\n",
      "ShipmentAmount_Port_of_Oslo_Port_of_Jebel_Ali = 5189339.4\n",
      "ShipmentAmount_Port_of_Santos_Port_of_Mersin = 4204466.2\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali = 129352810.0\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz = 144102190.0\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin = 25135444.0\n",
      "ShipmentAmount_Port_of_St._Petersburg_Port_of_Mersin = 4536578.5\n",
      "ShipmentAmount_Port_of_Vancouver_Port_of_King_Abdul_Aziz = 363811.29\n",
      "ShipmentAmount_Port_of_Vladivostok_Port_of_Mersin = 9195220.1\n",
      "Total kilogram_miles = 2512455842826.638\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
